// 导入自己封装的axios实例对象
import request from '@/utiles/request'

// 获取文章评论 或者某个评论的回复
export const getCommentList = params => {
    return request({
        url: '/v1_0/comments',
        params
    })
}

// 评论或回复添加点赞
export const addCommenZan = data => {
    return request({
        url: '/v1_0/comment/likings',
        method: 'POST',
        data
    })
}

// 评论或回复取消点赞
export const deleteCommenZan = target => {
    return request({
        url: '/v1_0/comment/likings/' + target,
        method: 'DELETE',
    })
}

// 添加评论或评论回复
export const addComment = data => {
    return request({
        url: '/v1_0/comments',
        method: 'POST',
        data
    })
}